from flask import jsonify, Blueprint, redirect


api_article = Blueprint('api_article', __name__)
api_article.url_prefix = "/api/article"


@api_article.route('/manage')
def manage_index():

    tasks = {"code": 0, "msg": "ok", "count": 1000, "data": [
        {
            "id": 10000,
            "username": "user-0",
            "sex": "女",
            "city": "城市-0",
            "sign": "签名-0",
            "experience": 255,
            "logins": 24,
            "wealth": 82830700,
            "classify": "作家",
            "score": 57
        }
    ]}

    tasks["msg"]="note"
    tasks["add"] = "note"
    json='{"key":"value"}'
    return jsonify(tasks)
"""
{
  "code": 0,
  "msg": "",
  "count": 1000,
  "data": [
    {
      "id": 10000,
      "username": "user-0",
      "sex": "女",
      "city": "城市-0",
      "sign": "签名-0",
      "experience": 255,
      "logins": 24,
      "wealth": 82830700,
      "classify": "作家",
      "score": 57
    }
  ]
}
"""
# @api_article_manage.route('/admin')
# def menu_admin():
#     tasks = [
#         {
#             'id': 1,
#             'title': u'订阅 python_mastery 专栏',
#             'description': u'专栏Link： https://xiaozhuanlan.com/python_mastery'
#         },
#         {
#             'id': 2,
#             'title': u'订阅 pythonml 专栏',
#             'description': u'专栏Link： https://xiaozhuanlan.com/pythonml'
#         }
#     ]
#     return jsonify({'tasks': tasks})